package com.itlaoqi.cf.service;

import com.itlaoqi.cf.dto.Member;

import java.util.HashMap;
import java.util.Map;

public class MemberService {

    private Map<String, Member> members = new HashMap<>();

    public MemberService() {
        // 初始化成员列表
        members.put("M001", new Member("M001", "Alice", "alice@example.com", "123-456-7890"));
        members.put("M002", new Member("M002", "Bob", "bob@example.com", "098-765-4321"));
        members.put("M003", new Member("M003", "Charlie", "charlie@example.com", "111-222-3333"));
    }


    public Map<String, Member> search() {
        System.out.println("execute MemberService.search()");
        try {
            Thread.sleep(3000);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
        return members;
    }
}
